<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:t="http://myfaces.apache.org/tomahawk">

<f:view>
<f:loadBundle var="messages" basename="messages"/>

<head>
	
<h1>Responder Topico</h1>
	
    <style type="text/css">
        .jscalendar-DB-div-style {
            position: absolute;
            margin-top: -69px;
            margin-left: -408px;
        }
    </style>
</head>

<h:messages errorClass="error" layout="table" style="width: 100%"/>
  

 
<h:form id="topicoForm">
<h:inputHidden value="#{topicoForm.topico.id}">
    <f:convertNumber/>
</h:inputHidden>
<h:panelGrid columns="3" styleClass="detail" columnClasses="label">
	
	
    <h:outputLabel value="Titulo do Topico:"/>
    <h:outputLabel value="#{topicoForm.topico.titulo}"/>
    <br />
    <br />
    <h:outputLabel value="Assunto do Topico:"/>
    <h:outputLabel value="#{topicoForm.topico.descricao}"/>
    <br />
    <br />
    
    <h:outputLabel for="Assunto" value="Titulo da Resposta:"/>
    <h:inputText value="#{topicoForm.subtopico.titulo}"
    id="titulo" 
    required="true" requiredMessage="O assunto deve ser informado!">
    <h:message for="titulo" styleClass="errorMessage"/>
    <f:validateLength maximum="30" />
    </h:inputText>
    <br />
    <br />
    <h:outputLabel for="Mensagem" value="Mensagem da Resposta:"/>   
    <h:inputTextarea value="#{topicoForm.subtopico.descricao}" 
    id="descricao" 
    required="true" requiredMessage="A mensagem deve ser informada!"
    cols="300" rows="300" style="overflow:scroll">
	<f:validateLength maximum="1000" />
	</h:inputTextarea>			
    <h:message for="descricao" styleClass="errorMessage"/>
    
	<!-- LISTA DE SUBTOPICOS AQUI -->

    <h:panelGroup>
        <h:commandButton value="Responder" action="#{topicoForm.saveSubtopico}" id="saveSubtopico" styleClass="button"/>
        <h:commandButton value="Cancelar" action="cancel" immediate="true" id="cancel" styleClass="button"/>
    </h:panelGroup>
    </h:panelGrid>
    
</h:form>

<script type="text/javascript">
    Form.focusFirstElement(document.forms['topicoForm']);
</script>

</f:view>
</html>